[IA64] Don't try to save nvram on PV domains
authorAlex Williamson <alex.williamson@hp.com>
Thu, 14 Jun 2007 21:32:22 +0000 (15:32 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Thu, 14 Jun 2007 21:32:22 +0000 (15:32 -0600)
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
tools/libxc/ia64/xc_ia64_hvm_build.c

index f58573882ba5139d87a2d878e0d23011059e095d..a3872f2aecb548ce546ce8f2427a6d7c44c75407 100644 (file)
@@ -709,11 +709,22 @@ copy_from_GFW_to_nvram(int xc_handle, uint32_t dom, int nvram_fd)
 
 int xc_ia64_save_to_nvram(int xc_handle, uint32_t dom) 
 {
+    xc_dominfo_t info;
     uint64_t nvram_fd = 0;
+
+    if ( xc_domain_getinfo(xc_handle, dom, 1, &info) != 1 )
+    {
+        PERROR("Could not get info for domain");
+        return -1;
+    }
+
+    if ( !info.hvm )
+        return 0;
+
     xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
 
     if ( !IS_VALID_NVRAM_FD(nvram_fd) )
-        PERROR("Nvram not be initialized. Nvram save fail!\n");
+        PERROR("Nvram not initialized. Nvram save failed!\n");
     else
         copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);